package com.data.common.util.jsonschema;

import com.alibaba.fastjson.JSONObject;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
import com.data.common.system.vo.DictModel;

public abstract class CommonProperty implements Serializable {

    private static final long f0l = -426159949502493187L;

    protected String f1a;

    protected String f2b;

    protected List<DictModel> f3c;

    protected Object f4d;

    protected String f5e;

    protected String f6f;

    protected Integer f7g;

    protected boolean f8h;

    protected String f9i;

    protected String f10j;

    protected Integer f11k;

    public abstract Map<String, Object> getPropertyJson();

    public String getDefVal() {
        return this.f9i;
    }

    public void setDefVal(String defVal) {
        this.f9i = defVal;
    }

    public boolean mo1a() {
        return this.f8h;
    }

    public void setDisabled(boolean disabled) {
        this.f8h = disabled;
    }

    public String getView() {
        return this.f5e;
    }

    public void setView(String view) {
        this.f5e = view;
    }

    public String getKey() {
        return this.f1a;
    }

    public void setKey(String key) {
        this.f1a = key;
    }

    public String getType() {
        return this.f2b;
    }

    public void setType(String type) {
        this.f2b = type;
    }

    public List<DictModel> getInclude() {
        return this.f3c;
    }

    public void setInclude(List<DictModel> include) {
        this.f3c = include;
    }

    public Object getConstant() {
        return this.f4d;
    }

    public void setConstant(Object constant) {
        this.f4d = constant;
    }

    public String getTitle() {
        return this.f6f;
    }

    public void setTitle(String title) {
        this.f6f = title;
    }

    public Integer getOrder() {
        return this.f7g;
    }

    public void setOrder(Integer order) {
        this.f7g = order;
    }

    public String getFieldExtendJson() {
        return this.f10j;
    }

    public void setFieldExtendJson(String fieldExtendJson) {
        this.f10j = fieldExtendJson;
    }

    public Integer getDbPointLength() {
        return this.f11k;
    }

    public void setDbPointLength(Integer dbPointLength) {
        this.f11k = dbPointLength;
    }

    public JSONObject getCommonJson() {
        JSONObject jSONObject = new JSONObject();
        jSONObject.put("type", this.f2b);
        if (this.f3c != null && this.f3c.size() > 0) {
            jSONObject.put("enum", this.f3c);
        }
        if (this.f4d != null) {
            jSONObject.put("const", this.f4d);
        }
        if (this.f6f != null) {
            jSONObject.put("title", this.f6f);
        }
        if (this.f7g != null) {
            jSONObject.put("order", this.f7g);
        }
        if (this.f5e == null) {
            jSONObject.put("view", "input");
        } else {
            jSONObject.put("view", this.f5e);
        }
        if (this.f8h) {
            jSONObject.put("ui", JSONObject.parseObject("{\"widgetattrs\":{\"disabled\":true}}"));
        }
        if (this.f9i != null && this.f9i.length() > 0) {
            jSONObject.put("defVal", this.f9i);
        }
        if (this.f10j != null) {
            jSONObject.put("fieldExtendJson", this.f10j);
        }
        if (this.f11k != null) {
            jSONObject.put("dbPointLength", this.f11k);
        }
        return jSONObject;
    }
}
